<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/common/taglibs.jsp"%>
<link rel="stylesheet" type="text/css" href="${ctx}/styles/pop.css" media="screen"/>
<script type="text/javascript" src="${ctx}/scripts/jquery/jquery.form.js"></script>
<div class="pop_roster_request">
	<div class="pop_roster_request_tit">
		申请加入组：<c:out value="${team.name}"/>
	</div>
	<form id="f_team_apply" action="<c:url value='/team/join.do'/>" method="post">
		<input type="hidden" name="teamid" value="${team.teamid}">
		<br/>最多250个字符<br/>
		<textarea rows="6" cols="25" name="applyPaper"></textarea>
		<br/>
		<input type="submit" class="btn3" value="发送请求">
	</form>
</div>
<script>
$("#f_team_apply").ajaxForm({
	success: processApplyJoinTeamResult
});
function processApplyJoinTeamResult(result){
	if($(result).find('result').text().toUpperCase().indexOf("TRUE") >= 0){
		$.fn.colorbox.close();
		alert('申请成功，请耐心等待组长审批！');
		$("#join_team_"+${team.teamid}).text("等待审批");
		$("#join_team_"+${team.teamid}).attr({"disabled":"disabled"});
	}else{
		alert($(result).find('content').text());
	}
}
</script>